package ynu.edu.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import ynu.edu.entity.OrderItemEntity;

import java.util.List;

/**
 * 订单项存储库
 */
@Repository
public interface OrderItemRepository extends JpaRepository<OrderItemEntity, Integer> {
    
    /**
     * 根据订单ID查询订单项列表
     */
    List<OrderItemEntity> findByOrderId(Integer orderId);
    
    /**
     * 根据订单ID删除所有订单项
     */
    void deleteByOrderId(Integer orderId);
} 